<?php
/**
 * Project: Recipe
 * File: SauceArticleModel.class.php
 * Author: Xnfy520@gmail.com
 * Date: 12-5-26
 * Time: 下午2:56
 */

class SauceArticleModel extends RelationModel{

	protected $_link = array(

		'User'=>array(
			'mapping_type'=>BELONGS_TO,
			'mapping_name'=>'userinfo',
			'class_name'=>'User',
			'foreign_key'=>'founder',
		),

		'SauceCategory'=>array(
			'mapping_type'=>BELONGS_TO,
			'mapping_name'=>'recipecategory',
			'class_name'=>'SauceCategory',
			'foreign_key'=>'recipecategoryid',
		),

		'RecipeMain'=>array(
			'mapping_type'=>HAS_ONE,
			'mapping_name'=>'recipemain',
			'class_name'=>'RecipeMain',
			'foreign_key'=>'recipearticleid',
			'condition'=>'recipetypeid=3'
		),

		'RecipeAccessory'=>array(
			'mapping_type'=>HAS_ONE,
			'mapping_name'=>'recipeaccessory',
			'class_name'=>'RecipeAccessory',
			'foreign_key'=>'recipearticleid',
			'condition'=>'recipetypeid=3'
		),

		'RecipeCondiment'=>array(
			'mapping_type'=>HAS_ONE,
			'mapping_name'=>'recipecondiment',
			'class_name'=>'RecipeCondiment',
			'foreign_key'=>'recipearticleid',
			'condition'=>'recipetypeid=3'
		),


	);

}